<template>
    <div class="turn-out">
        <van-nav-bar title="充值" left-arrow @click-left="goBack"/>
        <div class="content">
            <div class="out">
                <span>*</span>
                <label for="icon-type">选择币种</label>
                <input type="number" id="icon-type">
                <img src="../../../assets/images/icon-arrow-left.png" alt="">
            </div>
        </div>
        <div class="content address">
            <div class="out">
                <span>*</span>
                <label for="balance">充币地址</label>
                <input type="text" id="coin-address" disabled>
            </div>
            <button type="button" class="add-btn" id="id_copy" @click="copy">点击复制</button>
            <div class="ewm">
                二维码
            </div>
        </div>
        <div class="explain">
            <div class="title">充币说明</div>
            <div class="con">
                <p>1、禁止向BTC地址充值除BTC之外的资产，任何充入BTC之外的资产，任何充入BTC地址的非BTC资产将不可找回；</p>
                <p>2、使用BTC地址充值需要6个网络确认才能到账；</p>
                <p>3、充值最小额度为0.00000001BTC，小于0.00000001BTC将无法到账；</p>
            </div>
        </div>

    </div>
</template>
<script>
import Vue from "vue"
import axios from "axios"
import Clipboard from 'clipboard'
import {
    NavBar,
} from "vant"
export default {
    components: {
        [NavBar.name]: NavBar,
    },
    data() {
        return {
            msg: "",
            msgColor: false,
        }
    },
    created(){
        console.log(this.$route)
    },
    watch:{
        $route(to, from) {
      if (this.$route.params.id) {
        console.log(this.$route)
      }
    }
    },
    methods: {
        //返回上一页
        goBack() {
            this.$router.go(-1);
        },
        copy() {
            let clipboard = new Clipboard('#id_copy');
            clipboard.on('success', e => {
                // 释放内存
                this.msg="复制成功";
                this.msgColor=true;
                this.isShowPop=true;
                clipboard.destroy()
            })
            clipboard.on('error', e => {
                // 不支持复制
                this.msg="该浏览器不支持自动复制";
                this.isShowPop=true;
                this.msgColor=false;
                // 释放内存
                clipboard.destroy()
            })
        },
    }
}
</script>
<style lang="less" scoped>
.turn-out {
    .content {
        border-bottom: 1px solid #ebedf0;
        .out {
            display: flex;
            padding: 10px 15px;
            text-align: left;
            font-size: 14px;
            color: #323233;
            label {
                margin-right: 14px;
            }
            input {
                flex: 1;
                border: 0;
            }
            span {
                display: inline-block;
                margin: 4px 5px 0 0;
                font-size: 1.2em;
                color: #D1A658;
            }
        }
    }
    .address {
        border-bottom: 0;
        input {
            background: #efefef;
        }
        .add-btn {
            margin-left: -130px;
            background: #fff;
            font-size: 12px;
            color: #D1A658;
            outline: none;
            border: 0;
        }
    }
    .confirm {
        padding: 35px 15px;
        font-size: 14px;
        color: #fff;
        .btn {
            padding: 10px;
            width: 100%;
            height: 1.07rem;
            border: 0;
            border-radius: 3px;
            background: #D1A658;
            outline: none;
        }
    }
    .explain {
        padding: 0 15px;
        text-align: left;
        font-size: 12px;
        color: #969799f5;
        .title {
            padding-bottom: 10px;
            font-size: 14px;
            color: #323233;
        }
        .con {
            p {
                padding-bottom: 10px;
            }
        }
    }
}
</style>
